<include file="Public:head"/>
<body>
<div class="headk">
    <div class="head">
        <div class="floatleft">您好<a href="__MODULE__/Usercenter/index"><b style="color:red;">{$_SESSION["username"]}</b></a>，欢迎来到金蚂蚁装修网！<span>{$data}<a href="{:U('Home/City/index')}">【切换】</a></span></div>
        <div class="floatright">
        <?php 
if($_SESSION["id"]){?>
   <a href="__MODULE__/Usercenter/index"><b style="color:red;">进入个人中心</b></a> | <a href="__MODULE__/Usercenter/layout">注销</a>
<?php }else{ ?>
<a href="{:U('Home/Login/index')}">您还未登陆,点击登陆</a>
<?php }?>
            |<a href="{:U('Home/Register/ownreg')}">个人注册</a>|<a href="{:U('Home/Register/comreg')}">装修公司注册</a>
            |<a href="{:U('Zxwd/index')}">装修问答</a>|
            <span>服务热线:400-0606-129</span>
        </div>
    </div>
</div>
<div class="topbigdiv" bigheight="132" smallheight="103">
    <div class="top">
        <div class="logo">
            <a href="http://www.zxjmy.com">
                <img
                        src="__PUBLIC__/images/logo.png"
                        height="90">
            </a>
        </div>
        <include file="Public:read"/>
    </div>
</div>
<div class="topbigdivbg"></div>
<section class="self">
    <div class="content_wrap">
        <div class="main_content_box">
            <div class="main_container">
                <div class="global_pie">
                    <div class="global_pie_container">
                        <ul>
                            <li class="has_arrow">
                                <a href="/my">个人中心首页</a>
                                <span class="nav_arrow_right"></span>
                            </li>
                            <li class="has_arrow">
                                <a href="/my/yz_administration_self.php">我的个人资料</a>
                                <span class="nav_arrow_right"></span>
                            </li>
                            <li>我的个人资料</li>
                        </ul>
                    </div>
                </div>
                <!-- 左侧菜单 -->
                <div class="mc_menu_box">
                    <h2 class="mcmb_title mcmb_title_on"><a href="/my">个人中心首页</a></h2>
                    <ul class="mcmb_menu">


                        <li class="parent_menu" data_status="show">
                            <a href="javascript:void(0)"><i class="pm_icon_open sprite_img1"></i>我的收藏</a>
                            <ul class="child_menu">
                                <li><a href="/my/xgt_collection.php">效果图<span class="collect_count">0</span></a></li>
                                <li><a href="/my/zwj_collection.php">户型案例</a></li>

                                <li><a href="/my/bbs_posts.php?viewtype=collection">帖子</a></li>
                            </ul>
                        </li>
                        <li class="parent_menu" ><a href="javascript:void(0)"><i class="pm_icon_open sprite_img1"></i>问答和帖子</a>
                            <ul class="child_menu dn">
                                <li><a href="{:U('Home/Usercenter/tiwen',array('uid'=>$arr1['id']))}">我的提问</a></li>
                                <li><a href="{:U('Home/Usercenter/huida',array('uid'=>$arr1['id']))}">我的回答</a></li>
                                <li><a href="{:U('Home/Usercenter/fatie',array('uid'=>$arr1['id']))}">我的发帖</a></li>
                            </ul>
                        </li>
                        <li class="parent_menu"><a href="javascript:void(0)"><i class="pm_icon_open sprite_img1"></i>我的个人资料</a>
                            <ul class="child_menu dn">
                                <li><a href="{:U('Home/Usercenter/changemsg',array('id'=>$arr1['id']))}">个人资料</a></li>
                                <li><a href="{:U('Home/Usercenter/repassword',array('id'=>$arr1['id']))}">修改密码</a></li>
                                <li><a href="#">绑定手机/邮箱</a></li>
                            </ul>
                        </li>

                    </ul>
                </div>
                <script type="text/javascript">
                    var jq = $;
                    jq(function()
                    {
                        menuShrinknew();
                    });
                    function menuShrinknew(){
                        jq('.parent_menu').children('a').unbind('click');
                        jq('.parent_menu').children('a').click(function(){
                            var dataStatus = jq(this).parent('.parent_menu').attr('data_status');
                            if(dataStatus=='hide'){
                                jq(this).parent('.parent_menu').find('.child_menu').show();
                                jq(this).parent('.parent_menu').attr('data_status','show');
                                jq(this).find('i').removeClass('pm_icon_close').addClass('pm_icon_open');
                            }
                            else{
                                jq(this).parent('.parent_menu').find('.child_menu').hide();
                                jq(this).parent('.parent_menu').attr('data_status','hide');
                                jq(this).find('i').removeClass('pm_icon_open').addClass('pm_icon_close');
                            }
                        });
                        jq('.child_menu li').click(function(){
                            jq('.child_menu li').removeClass('child_menu_on');
                            jq(this).addClass('child_menu_on');
                        })
                    }
                </script>            <!-- 左侧菜单 -->
                <div class="right_content">
                    <div class="clumn_name">
                        <p>我的个人资料</p>
                    </div>

                    <form method="post" action="__URL__/xiugai" onsubmit="return checkform1(this)" enctype="multipart/form-data" id="fm">
                        <div class="personal_info">
                            <div>
                                <input type="text" name="id" id="id" value="{$arr.id}" style="display:none">

                            </div>
                            <div>
                                <label>用&nbsp;&nbsp;户&nbsp;&nbsp;名：</label><span>{$arr1.username}</span>
                            </div>
                            <div>
                                <label>昵&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;称：</label>
                                <input type="text" id="name" name="name" value="{$arr1.name}">
                                <div class="message"></div>
                            </div>
                            <div>
                                <label>性&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;别：</label>
                                <?php if($arr1["sex"]==1){?>
                                <input type="radio" id="sex" name="sex" value="1" checked="checked">&nbsp;&nbsp;男<!--</label>-->
                                <input type="radio" id="sex" name="sex" value="0">&nbsp;&nbsp;女<!--</label>-->
                                <?php }else{ ?>
                                <input type="radio" id="sex" name="sex" value="1" checked="checked">&nbsp;&nbsp;男<!--</label>-->
                                <input type="radio" id="sex" name="sex" value="0">&nbsp;&nbsp;女<!--</label>-->
                                <?php } ?>
                                <div class="message"></div>
                            </div>
                            <div>
                                <label>QQ：</label>
                                <input type="text" id="qq" value="{$arr1.qq}" name="qq">
                                <div class="message"></div>
                            </div>
                            <div class="stats">
                                <label>注册状态：</label>
                                <select name="zczhuangtai" id="zczhuangtai">
                                    <option value="还没买房" selected="selected">还没买房</option>
                                    <option value="已买房，未拿到钥匙">已买房，未拿到钥匙</option>
                                    <option value="准备装修">准备装修</option>
                                    <option value="已订装修公司">已订装修公司</option>
                                    <option value="已经装修了">已经装修了</option>
                                </select>
                            </div>
                            <div class="city">
                                <label>所在城市：</label>
                               <div class="zcityGroup" name="city" city-range="{'level_start':1,'level_end':3}" city-ini="{$arr.city}"></div>
                               </div>
                             <div class="this_head" id="this_head" >
                                <label>当前头像：</label>
                                <img src="__PUBLIC__/images/570.jpg" id="p_view_img_1" width="75" height="75">                        </div>
                            <div class="photo_content">
                                <div class="upload_pic clearfix">
                                    <div id="altContent"></div>
                                    <div id="avatar_priview"></div>
                                </div>
                            </div>
                            <div class="btn">
                                <input type="button" id="sub" value="提交">
                            </div>
                        </div>
                    </form>
                     <script>

              $('#sub').click(function () {
                var id=$("#id").val();
                var name=$("#name").val();
                var a = $('.zcityGroup').find('.currentValue')
                var city=a.eq(0).val()+','+a.eq(1).val()+','+a.eq(2).val()
                var sex=$("#sex").val();
                var zczhuangtai=$("#zczhuangtai").val();
                    console.log(id,name,city,sex,zczhuangtai)
                    $.ajax({
                       type: "POST",
                       dataType: 'json',
                       url: '__CONTROLLER__/xiugai',
                       data: {
                            id:id,
                         name:name,
                         city:city,
                         sex:sex,
                         zczhuangtai:zczhuangtai,
                        
                       },
                       success: function (data) {
                            if(data.msg==1){
                                alert("修改成功")
                            }
                       },
                       error: function (data) {
                            if(data.msg==0){
                                alert("修改失败")
                            }
                       }

                   })

                })
         </script>
                </div>
            </div>
        </div>
    </div>
</section>


<include file="Public:foot"/>

<script src="__PUBLIC__/js/zcity.js"></script>

<script>
    zcityrun('.zcityGroup');
</script>
</body>
</html>